<template>
  <el-card class="m-card" v-bind="$attrs">
    <template #header v-if="$slots.header">
      <slot name="header"></slot>
    </template>
    
    <!-- 添加光束效果元素 -->
   <!--  <div class="border-beam-top"></div>
    <div class="border-beam-right"></div>
    <div class="border-beam-bottom"></div>
    <div class="border-beam-left"></div> -->
    
    <!-- 添加角落装饰 -->
   <!--  <div class="corner-decoration top-left"></div>
    <div class="corner-decoration top-right"></div>
    <div class="corner-decoration bottom-right"></div>
    <div class="corner-decoration bottom-left"></div> -->
    
    <!-- 添加数据流动效果 -->
    <!-- <div class="data-flow"></div> -->
    
    <!-- 默认插槽 -->
    <slot></slot>
  </el-card>
</template>

<script setup lang="ts">
// 组件属性继承自el-card
defineOptions({
  name: 'MCard',
  inheritAttrs: false
})
</script>

<style lang="scss" scoped>
.m-card {
  position: relative;
  overflow: hidden;
  
  // 光束效果
 /*  .border-beam-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(0, 209, 237, 0.8),
      transparent
    );
    filter: blur(1px);
    z-index: 10;
    box-shadow: 
      0 0 5px rgba(0, 209, 237, 0.5),
      0 0 10px rgba(0, 209, 237, 0.3),
      0 0 15px rgba(0, 209, 237, 0.1);
    animation: beam-top 4s linear infinite;
    opacity: 0.8;
  }
  
  .border-beam-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 50px;
    background: linear-gradient(
      180deg,
      transparent,
      rgba(0, 209, 237, 0.8),
      transparent
    );
    filter: blur(1px);
    z-index: 10;
    box-shadow: 
      0 0 5px rgba(0, 209, 237, 0.5),
      0 0 10px rgba(0, 209, 237, 0.3),
      0 0 15px rgba(0, 209, 237, 0.1);
    animation: beam-right 4s linear infinite;
    animation-delay: 1s;
    opacity: 0.8;
  }
  
  .border-beam-bottom {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(0, 209, 237, 0.8),
      transparent
    );
    filter: blur(1px);
    z-index: 10;
    box-shadow: 
      0 0 5px rgba(0, 209, 237, 0.5),
      0 0 10px rgba(0, 209, 237, 0.3),
      0 0 15px rgba(0, 209, 237, 0.1);
    animation: beam-bottom 4s linear infinite;
    animation-delay: 2s;
    opacity: 0.8;
  }
  
  .border-beam-left {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2px;
    height: 50px;
    background: linear-gradient(
      180deg,
      transparent,
      rgba(0, 209, 237, 0.8),
      transparent
    );
    filter: blur(1px);
    z-index: 10;
    box-shadow: 
      0 0 5px rgba(0, 209, 237, 0.5),
      0 0 10px rgba(0, 209, 237, 0.3),
      0 0 15px rgba(0, 209, 237, 0.1);
    animation: beam-left 4s linear infinite;
    animation-delay: 3s;
    opacity: 0.8;
  }
  
  // 角落装饰
  .corner-decoration {
    position: absolute;
    width: 15px;
    height: 15px;
    z-index: 5;
    
    &.top-left {
      top: 0;
      left: 0;
      border-top: 2px solid rgba(0, 209, 237, 0.6);
      border-left: 2px solid rgba(0, 209, 237, 0.6);
      border-top-left-radius: 8px;
      animation: corner-pulse 3s infinite alternate;
    }
    
    &.top-right {
      top: 0;
      right: 0;
      border-top: 2px solid rgba(0, 209, 237, 0.6);
      border-right: 2px solid rgba(0, 209, 237, 0.6);
      border-top-right-radius: 8px;
      animation: corner-pulse 3s infinite alternate;
      animation-delay: 0.5s;
    }
    
    &.bottom-right {
      bottom: 0;
      right: 0;
      border-bottom: 2px solid rgba(0, 209, 237, 0.6);
      border-right: 2px solid rgba(0, 209, 237, 0.6);
      border-bottom-right-radius: 8px;
      animation: corner-pulse 3s infinite alternate;
      animation-delay: 1s;
    }
    
    &.bottom-left {
      bottom: 0;
      left: 0;
      border-bottom: 2px solid rgba(0, 209, 237, 0.6);
      border-left: 2px solid rgba(0, 209, 237, 0.6);
      border-bottom-left-radius: 8px;
      animation: corner-pulse 3s infinite alternate;
      animation-delay: 1.5s;
    }
  }
  
  // 数据流动效果
  .data-flow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
    opacity: 0.1;
    
    &::before {
      content: '';
      position: absolute;
      width: 200%;
      height: 200%;
      top: -50%;
      left: -50%;
      background-image: 
        radial-gradient(rgba(0, 209, 237, 0.1) 1px, transparent 1px),
        radial-gradient(rgba(0, 209, 237, 0.1) 1px, transparent 1px);
      background-size: 30px 30px;
      background-position: 0 0, 15px 15px;
      animation: data-flow 20s linear infinite;
    }
  } */
}

// 光束动画
/* @keyframes beam-top {
  0% {
    left: -50px;
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    left: calc(100% + 50px);
    opacity: 0;
  }
}

@keyframes beam-right {
  0% {
    top: -50px;
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    top: calc(100% + 50px);
    opacity: 0;
  }
}

@keyframes beam-bottom {
  0% {
    right: -50px;
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    right: calc(100% + 50px);
    opacity: 0;
  }
}

@keyframes beam-left {
  0% {
    bottom: -50px;
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    bottom: calc(100% + 50px);
    opacity: 0;
  }
}

@keyframes corner-pulse {
  0% {
    box-shadow: 0 0 5px rgba(0, 209, 237, 0.3);
    opacity: 0.7;
  }
  100% {
    box-shadow: 0 0 10px rgba(0, 209, 237, 0.5);
    opacity: 1;
  }
}

@keyframes data-flow {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(-20%) rotate(20deg);
  }
} */
</style> 